import hashlib
import sys

import os
from pathlib import Path

from flow_alchemy.util.id_work import IdWorker
from flow_alchemy.core.log_manage import LogManage

PY = sys.version_info[0]
PY2 = PY == 2
PY3 = PY == 3
if PY2:
    MAXINT = sys.maxint
elif PY3:
    MAXINT = sys.maxsize
else:
    MAXINT = 9223372036854775807

MYSQL_MAXINT = (1 << 31) - 1

BASE_DIR = Path(__file__).resolve().parent.parent
NUMBER128 = '6704651547771731225774319636644825309807427640133843018343720315' \
            '0234751928636715265665168230418385645032701770378892895577895325'


def join_path(*path) -> str:
    _path = [str(_) for _ in path]
    return os.sep.join(_path)


# LOG_DIR = join_path(BASE_DIR.parent, 'logs')
LOG_DIR = 'E://logs'
id_worker = IdWorker(worker_id=1, sequence=0)


def make_mark(data):
    return hashlib.md5(data.encode('utf8')).hexdigest()


log_manage = LogManage()
